<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<script>
description("This tests the handling of the script.crossOrigin attribute");
var script = document.createElement("script");
shouldBeTrue("'crossOrigin' in script");
shouldBeNull("script.crossOrigin");
shouldBeEqualToString("script.setAttribute('crossorigin', ''); script.crossOrigin", "anonymous");
shouldBeNull("script.removeAttribute('crossorigin'); script.crossOrigin");
shouldBeEqualToString("script.setAttribute('crossorigin', 'foo'); script.crossOrigin", "anonymous");
shouldBeEqualToString("script.setAttribute('crossorigin', 'ANONYMOUS'); script.crossOrigin", "anonymous");
shouldBeEqualToString("script.setAttribute('crossorigin', 'use-credentials'); script.crossOrigin", "use-credentials");
shouldBeEqualToString("script.crossOrigin = ''; script.getAttribute('crossorigin')", "");
shouldBeEqualToString("script.crossOrigin = 'foo'; script.getAttribute('crossorigin')", "foo");
shouldBeFalse("script.crossOrigin = null; script.hasAttribute('crossorigin')");
shouldBeEqualToString("script.crossOrigin = 'ANONYMOUS'; script.getAttribute('crossorigin')", "ANONYMOUS");
shouldBeEqualToString("script.crossOrigin = 'use-credentials'; script.getAttribute('crossorigin')", "use-credentials");
</script>
